//
//  UIButton+Button.m
//  FangXinLang
//
//  Created by AJY on 16/9/18.
//  Copyright © 2016年 AJY. All rights reserved.
//

#import "UIButton+Button.h"

@implementation UIButton (Button)

+(UIButton *)ButtonWith:(UIButton *)btn andBackgroundImage:(NSString *)backgroundImage andTitle:(NSString *)title andTitleColor:(UIColor *)titleColor andTarget:(id)self1 andAction:(SEL)select{
    //设置背景图片
    [btn setBackgroundImage:[UIImage imageNamed:backgroundImage] forState:UIControlStateNormal];
    //设置按钮字体
    [btn setTitle:title forState:UIControlStateNormal];
    //设置按钮字体颜色
    [btn setTitleColor:titleColor forState:UIControlStateNormal];
    //设置单击事件
    [btn addTarget:self1 action:select forControlEvents:UIControlEventTouchUpInside];
    //设置自适应
    [btn sizeToFit];
    return btn;
}

@end
